import { Get, Post, Body, Patch, Param, Delete, Query } from "@nestjs/common";

export class CrudController {
    private readonly service;
    
    constructor(Service) {
        this.service = Service;
    }
    
    @Post()
    create(@Body() createLogDto) {
        return this.service.create(createLogDto);
    }
    
    @Get()
    findAll(@Query() dto) {
        return this.service.findAll(dto);
    }
    
    @Get(":id")
    findOne(@Param("id") id: string) {
        return this.service.findOne(+id);
    }
    
    @Patch(":id")
    update(@Param("id") id: string, @Body() updateLogDto) {
        return this.service.update(+id, updateLogDto);
    }
    
    @Delete("removeByIds")
    removeByIds(@Body() dto) {
        return this.service.removeByIds(dto);
    }
    
    @Delete(":id")
    remove(@Param("id") id: string) {
        return this.service.remove(+id);
    }
}
